import { defineStore } from "pinia";

interface SplitOptions {
  edges: {
    enabled: boolean;
    options: string[];
  };
  vertex: {
    enabled: boolean;
    selected: boolean;
  };
}

export const useMeshEditStore = defineStore("meshEditStore", {
  state: () => ({
    fillHoleModalActive: false,
    removePenetrationModalActive: false,
    splitModalActive: false,
    stretchModalActive: false,
    swapModalActive: false,
    sweepModalActive: false,
  }),
  actions: {
    setFillHoleModalActive(value: boolean) {
      this.fillHoleModalActive = value;
    },
    setRemovePenetrationModalActive(value: boolean) {
      this.removePenetrationModalActive = value;
    },
    setSplitModalActive(value: boolean) {
      this.splitModalActive = value;
    },
    setStretchModalActive(value: boolean) {
      this.stretchModalActive = value;
    },
    setSwapModalActive(value: boolean) {
      this.swapModalActive = value;
    },
    setSweepModalActiveActive(value: boolean) {
      this.sweepModalActive = value;
    },
    handleSplitOptions(options: SplitOptions) {
      console.log('Split options:', options);
    }
  },
});
